package cn.z2huo.knowledge.java.base.java.lang;

/**
 * <p>
 *
 * @author z2huo
 */
public class RuntimeTest {

    public static void main(String[] args) {
        System.out.println(Runtime.getRuntime().availableProcessors());
        System.out.println(Runtime.getRuntime().freeMemory());
        System.out.println(Runtime.getRuntime().totalMemory());
        System.out.println(Runtime.getRuntime().maxMemory());

        // 配置了 -Xms1024m -Xmx1024m JVM 配置
        // 输出的结果为修改后的配置
        System.out.println(Runtime.getRuntime().freeMemory() / 1024 / 1024);
        System.out.println(Runtime.getRuntime().totalMemory() / 1024 / 1024);
        System.out.println(Runtime.getRuntime().maxMemory() / 1024 / 1024);
    }

}
